package com.xca.znb.model.impl;

import android.content.Context;

import com.xca.znb.database.UserDAO;
import com.xca.znb.entity.Collect;
import com.xca.znb.entity.News;
import com.xca.znb.entity.User;
import com.xca.znb.model.imodel.IShowNews;

public class ShowNewsImpl implements IShowNews {
    private UserDAO userDAO ;
    public ShowNewsImpl(Context context){
        userDAO = new UserDAO(context);
    }
    @Override
    public News getNewsById(int id) {
        return userDAO.getNewsById(id);
    }

    @Override
    public User getUserByPhone(String phone) {
        return userDAO.getUser(phone);
    }

    @Override
    public void addCollect(String gId, String type, String user) {
        userDAO.addCollect(gId, type, user);
    }

    @Override
    public void delCollect(int id) {
        userDAO.delCollect(id);
    }

    @Override
    public Collect getCollect(String gId, String type, String user) {
        return userDAO.getCollect(gId, type, user);
    }
}
